﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Garlic.CC.BaseClass;
using Garlic.CC.Utility;
using Garlic.BLL.Common;
using Garlic.DM.DataModel;
using Garlic.CC.WebUtility;
using Garlic.BLL;


public partial class SystemManagement_CodeDetailEdit : BasePage
{

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            string code_name = Request.QueryString["code_name"];
            string code_value = Request.QueryString["code_value"];

            if (!(string.IsNullOrEmpty(code_name)) && !(string.IsNullOrEmpty(code_value)))
            {
                this.formCodeDetail.DefaultMode = FormViewMode.Edit;
            }
            else
            {
                this.ShowMessage("页面需要代码名称和代码值信息！");
                //this.Response.Write("<script language=javascript>window.close();</script>"); 
            }
        }
    }

    private void ShowMessage(string msg)
    {
        this.Message = msg;
    }

    protected void TopToolBar_OnClick(object sender, Garlic.UI.Components.IconButtonClickEventArgs args)
    {
        switch (args.Command)
        {
            case ToolbarCommand.Save:
                this.formCodeDetail.UpdateItem(true);
                break;
        }
    }
}
